var server_path;
var thePopup;
$(document).ready(function(){
	$('#individual_table').dataTable();
   server_path = $("#server_path").val();
  
});
function open_products(order){
	sendData = 'get_order_products='+order;	
	$.ajax({
         type: "POST",
         url: server_path+"libs/order_ajax.php",
         data: sendData,
         // dataType:'json',
         success: function(data){ 
         	$("#order_products").html(data);
         	$("#order_prod_table").dataTable();
         	$('#modal-order-products').modal();
         }
     }); 	

	
}
function open_and_send(order){
 
   sendData = 'print_send='+order;   
   $.ajax({
         type: "POST",
         url: server_path+"libs/order_ajax.php",
         data: sendData,
         // dataType:'json',
         success: function(data){
         $("#print_send").html(data); 
            container =$("<div>"+data+"</div>");
            setTimeout(function(){
            thePopup=window.open( '', "Product Print", "height=900,width=900;titlebar=1;" );
                  


                container.clone().appendTo( thePopup.document.body );
                thePopup.print();
                thePopup.close();
            },1000);
          
         }
     });    

   
}
function print_order(order){
 
   sendData = 'print_order='+order;   
   $.ajax({
         type: "POST",
         url: server_path+"libs/order_ajax.php",
         data: sendData,
         // dataType:'json',
         success: function(data){
         $("#print_send").html(data); 
            containerr =$("<div>"+data+"</div>");
            setTimeout(function(){
            thePopupp=window.open( '', "Product Print", "height=900,width=900;titlebar=1;" );
                  


                containerr.clone().appendTo( thePopupp.document.body );
                thePopupp.print();
                thePopupp.close();
            },1000);
          
         }
     });    

   
}